﻿<%@ Page Title="View Income List" Language="C#" MasterPageFile="~/Layout.master"
    AutoEventWireup="true" CodeFile="IncomeList.aspx.cs" Inherits="Secured_IncomeList"
    Theme="Default" Buffer="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder1" runat="Server">
    <div style="font-size: large">
        View Income List
    </div>
    <br />
    <div>
        <asp:Literal ID="ltMsg" runat="server" />
    </div>
    <br />
    <div>
        <fieldset style="padding: 5px">
            <legend>Filter:</legend><span>
                <asp:CheckBox ID="chkFilterByMonthYear" runat="server" AutoPostBack="true" OnCheckedChanged="chkFilterByMonthYear_CheckedChanged" /><strong>By
                    Month:</strong><asp:DropDownList ID="cmbIncomeMonth" runat="server" AutoPostBack="true">
                        <asp:ListItem Text="Jan" Value="Jan" />
                    </asp:DropDownList>
                &nbsp;<asp:DropDownList ID="cmbYear" runat="server" />
                &nbsp; <span>
                    <asp:CheckBox ID="chkFilterByExpHead" runat="server" AutoPostBack="true" /><strong>By
                        Expense Head:</strong></span>&nbsp;<asp:DropDownList ID="cmbExpenseHead" runat="server"
                            AutoPostBack="True" />
                &nbsp;<asp:CheckBox ID="chkFilterByUser" runat="server" AutoPostBack="true" /><strong>By
                    User:</strong><asp:DropDownList ID="cmbUsers" runat="server" />
            </span>
            <div style="float: right">
                <asp:Button ID="btnRefreshReport" runat="server" Text="Refresh Report" />
            </div>
        </fieldset>
    </div>
    <br />
    <div>
        <asp:GridView ID="grdIncome" runat="server" BackColor="White" BorderColor="#CC9966"
            BorderStyle="None" BorderWidth="1px" CellPadding="4" AutoGenerateEditButton="True"
            AutoGenerateColumns="False" 
            DataKeyNames="IncomeID,IncomeDate,PaidBy,ExpenseHead,ForPeriod,IncNotes,Comments,IncomeAmount" 
            EnableModelValidation="True">
            <RowStyle BackColor="White" ForeColor="#330099" />
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <AlternatingRowStyle BackColor="#FFDD97" />
            <Columns>
                <asp:BoundField DataField="IncomeID" Visible="false" />
                <asp:TemplateField HeaderText="Added On">
                    <ItemTemplate>
                        <%# Eval("IncomeDate","{0:MMM dd, yyyy}") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEditIncomeDate" runat="server" Text='<%# Eval("IncomeDate","{0:MMM dd, yyyy}") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Paid By">
                    <ItemTemplate>
                        <%# Eval("PaidBy") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="cmbEditPaidBy" runat="server" SelectedText='<%# Eval("PaidBy") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="For Month">
                    <ItemTemplate>
                        <%# Eval("ForPeriod") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEditForPeriod" runat="server" Text='<%# Eval("ForPeriod") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Under Head">
                    <ItemTemplate>
                        <%# Eval("ExpenseHead") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="cmbEditExpenseHead" runat="server" SelectedText='<%# Eval("ExpenseHead") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Notes">
                    <ItemTemplate>
                        <%# Eval("IncNotes") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEditIncNotes" runat="server" TextMode="MultiLine" Rows="5" Columns="30"
                            Text='<%# Eval("IncNotes") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Amount">
                    <ItemTemplate>
                        <%# Eval("IncomeAmount") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEditIncomeAmount" runat="server" Text='<%# Eval("IncomeAmount") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Comments">
                    <ItemTemplate>
                        <%# Eval("Comments") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEditComments" runat="server" TextMode="MultiLine" Rows="5" Columns="30"
                            Text='<%# Eval("Comments") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                No Data to Fetch!
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    <br />
    <div>
        <strong>Total:</strong>&nbsp;<asp:TextBox ID="txtTotal" runat="server" />
    </div>
</asp:Content>
